<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menubar model="#{getMessageManagedBean.staffMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <h:form>
            <f:view beforePhase="#{getMessageManagedBean.initView}">
                <h:body>
                    <p:messages id="statusMessages" redisplay="false" />
                    <p:panel header="Message Details" >

                        <h:panelGrid columns="2" width="780px">
                            <br/>
                            <h:column id="buttons">
                                <p:commandButton value="Delete" actionListener="#{getMessageManagedBean.deleteMessage}" style="float:right;"/>
                                <p:commandButton value="Mark as unread" actionListener="#{getMessageManagedBean.markUnread}" rendered="${getMessageManagedBean.fromOutbox==false}" 
                                                 style="float:right;"/>

                            </h:column>

                            <h:outputText id="labelActivityType" value="Sender: " style="font-weight: bold;" />

                            <h:outputLabel id="staffMsg" value="#{getMessageManagedBean.message.sender}"/>

                            <h:outputText id="labelDate" value="Date: " style="font-weight: bold" />

                            <h:outputLabel id="date" value="#{getMessageManagedBean.message.msgDate}">
                                <f:convertDateTime dateStyle="long" type="both"/>
                            </h:outputLabel>


                            <h:outputText id="labelSubject" value="Subject " style="font-weight: bold" />
                            <h:outputText value="#{getMessageManagedBean.message.subject}" 
                                          id ="eventTitle" style="float: left;"/>
                            <h:column/>

                        </h:panelGrid>
                        <p:separator/>
                        <h:panelGrid columns="1" width="780px;">
                            <h:outputText escape="false" value="#{getMessageManagedBean.message.message}" 
                                          id ="themessage" style="width:740px; "/>
                            <p:commandButton value="Reply" style="float: right;" actionListener="#{getMessageManagedBean.replyMessage}" rendered="${getMessageManagedBean.fromOutbox==false}"/>

                        </h:panelGrid>
                    </p:panel>
                    <p:ajaxStatus>  
                        <f:facet name="start">  
                            <h:graphicImage value="../design/ajaxloading.gif" />  
                        </f:facet>  

                        <f:facet name="complete">  
                            <h:outputText value="" />  
                        </f:facet>  
                    </p:ajaxStatus> 
                </h:body>
            </f:view>
        </h:form>
    </ui:define>
</ui:composition>
